package com.xhwl.centiotdata.service.cent;

import com.alibaba.fastjson.JSONObject;
import com.xhwl.common.vo.devicecore.*;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @description:
 * @author: wuyuhao
 * @createDate: 2022/12/11 9:55
 */
@FeignClient(name = "DEVICECORE-WEBAPI")
public interface IDeviceCoreWebapiService {

    /**
     * 设备详情
     * @param detailVO
     * @return
     */
    @RequestLine(value = "POST /devicecore/v1/detail")
    JSONObject deviceDetail(@RequestBody DeviceDetailVO detailVO);

    /**
     * 设备列表
     * @param listVO
     * @return
     */
    @RequestLine(value = "POST /devicecore/v1/list")
    JSONObject deviceList(@RequestBody DeviceListVO listVO);

    /**
     * 设备属性控制(IOT)
     * @param controlVO
     * @param appId
     * @param userId
     * @return
     */
    @RequestLine(value = "POST /device/v1/control")
    @Headers({"appId: {appId}", "userId: {userId}"})
    JSONObject deviceControl(@RequestBody ControlVO controlVO,
                             @Param("appId") String appId,
                             @Param("userId") String userId);

    /**
     * 获取设备当前属性值
     * @param shadowListVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/shadowList")
    JSONObject deviceShadowList(@RequestBody ShadowListVO shadowListVO);

    /**
     * 设备服务控制
     * @param serviceControlVO
     * @param appId
     * @param userId
     * @return
     */
    @RequestLine(value = "POST /device/v1/serviceControl")
    @Headers({"appId: {appId}", "userId: {userId}"})
    JSONObject deviceServiceControl(@RequestBody ServiceControlVO serviceControlVO,
                                    @Param("appId") String appId,
                                    @Param("userId") String userId);

    /**
     * 获取服务列表
     * @param serviceListVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/serviceList")
    JSONObject deviceServiceList(@RequestBody ServiceListVO serviceListVO);

    /**
     * 新增设备群组
     * @param addDeviceGroupVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/device-group/add")
    JSONObject deviceGroupAdd(@RequestBody AddDeviceGroupVO addDeviceGroupVO);

    /**
     * 删除设备群组
     * @param deleteDeviceGroupVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/device-group/delete")
    JSONObject deviceGroupDelete(@RequestBody DeleteDeviceGroupVO deleteDeviceGroupVO);

    /**
     * 设备群组详情
     * @param deviceGroupDetailVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/device-group/detail")
    JSONObject deviceGroupDetail(@RequestBody DeviceGroupDetailVO deviceGroupDetailVO);

    /**
     * 编辑设备群组
     * @param editDeviceGroupVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/device-group/edit")
    JSONObject deviceGroupEdit(@RequestBody EditDeviceGroupVO editDeviceGroupVO);

    /**
     * 设备群组列表
     * @param getDeviceGroupListVO
     * @return
     */
    @RequestLine(value = "POST /device/v1/device-group/list")
    JSONObject deviceGroupList(@RequestBody GetDeviceGroupListVO getDeviceGroupListVO);

}
